export function useCommon() {
  // 根据学科返回对应的颜色
  const getGradeColor = (grade: string) => {
    if (grade === '语文') {
      return '#FC6A6A'
    } else if (grade === '数学') {
      return '#00AEFF'
    } else if (grade === '英语') {
      return '#FF7DCE'
    } else if (grade === '物理') {
      return '#696FFF'
    } else if (grade === '化学') {
      return '#32D3E8'
    } else if (grade === '生物') {
      return '#59C261'
    } else if (grade === '政治') {
      return '#FC7979'
    } else if (grade === '历史') {
      return '#EFC442'
    } else if (grade === '地理') {
      return '#FF6A00'
    } else if (grade === '科学') {
      return '#C98BFB'
    } else {
      return '#00AEFF'
    }
  }

  // 获取星期名称
  const getWeekName = (dayOfWeek: number | null) => {
    switch (dayOfWeek) {
      case 1:
        return '周一'
      case 2:
        return '周二'
      case 3:
        return '周三'
      case 4:
        return '周四'
      case 5:
        return '周五'
      case 6:
        return '周六'
      case 7:
        return '周日'
      default:
        return ''
    }
  }

  return {
    getGradeColor,
    getWeekName
  }
}
